function registerNS(ns) {
	var nsParts = ns.split(".");
	var root = window;

	for ( var i = 0; i < nsParts.length; i++) {
		if (typeof root[nsParts[i]] == "undefined")
			root[nsParts[i]] = new Object();

		root = root[nsParts[i]];
	}
}

function parseDateString(str) {
	if (str != null && (str = $.trim(str)) != "") {
		var valid = false;
		var month = 1, day = 1, year, yearStr;
		if (/^\d?\d\/\d?\d\/(\d{2})?\d{2}$/.test(str)) {
			var arr = str.split("/");
			month = parseInt(arr[0], 10);
			day = parseInt(arr[1], 10);
			year = parseInt(yearStr = arr[2], 10);
			valid = month >= 1 && day >= 1 && year >= 0;
		} else if (/^\d?\d\/(\d{2})?\d{2}$/.test(str)) {
			var arr = str.split("/");
			month = parseInt(arr[0], 10);
			year = parseInt(yearStr = arr[1], 10);
			valid = month >= 1 && year >= 0;
		} else if (/^(\d{2})?\d{2}$/.test(str)) {
			year = parseInt(yearStr = str, 10);
			valid = year >= 0;
		}
		if (valid) {
			if (year <= 99/*yearStr.length == 2*/) year = 2000 + year;
			return new Date(year, month - 1, day);
		}
	}
	return null;
}

function validateMonthDayString(str) {
	if (str != null && (str = $.trim(str)) != "") {
		if (/^\d?\d\/\d?\d$/.test(str)) {
			var arr = str.split("/");
			var month = parseInt(arr[0], 10);
			var day = parseInt(arr[1], 10);
			if (month >= 1 && day >= 1) {
				return (month < 9 ? "0" : "") + month + "/" +(day < 9 ? "0" : "") + day;
			}
		}
	}
	return null;
}